<?php
header("Content-Type: text/html; charset=ISO-8859-1",true);
if(!isset($_SESSION))session_start();
if(!isset($_SESSION['usuario'])){
	session_destroy();
	header("location:index.php"); exit;
	}

include 'classes/Crud.php';
$con = new Crud();
$con->connect();
$setor = $_POST[setor];
$ss=mysql_real_escape_string($_GET['q']);
$op = mysql_query("select nome from funcionario where locate('$ss', setor)>0 order by nome asc ") or die (mysql_error());
while ($linha = mysql_fetch_array($op)){
$nome = $linha[nome];
$html = preg_replace("/(" . $ss . ")/i", "<span style=\"font-weight:bold\">\$1</span>", $nome);
echo "<option>$html</option>";

}


?>
